﻿using ISSMoviePlex.DAL.Repositories;
using ISSMoviePlex.DAL.Models;

namespace ISSMoviePlex.BLL
{
    public class GenreBLL
    {
        private readonly GenreRepository _genreRepository;

        public GenreBLL()
        {
            _genreRepository = GenreRepository.Instance;
            _genreRepository.Initialize();
        }

        public dynamic GetAllGenres()
        {
            return _genreRepository.GetAllGenres();
        }
        public Genre GetGenre(int genreId)
        {
            return _genreRepository.FindById(genreId);
        }
        public void AddGenre(Genre genre)
        {
            _genreRepository.Add(genre);
            _genreRepository.Save();
        }
        public void DeleteGenre(Genre genre)
        {
            _genreRepository.Delete(genre);
            _genreRepository.Save();
        }
    }
}
